import '@/assets/base.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import piniaPluginPersist from 'pinia-plugin-persist'
// markdown
import VMdEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
import '@kangc/v-md-editor/lib/theme/style/github.css';
import hljs from 'highlight.js';
import drag from "v-drag"
import '@wangeditor/editor/dist/css/style.css';
import WangEditorPlugin from './plugins/wangEditorPlugin.js';


const app = createApp(App)


VMdEditor.use(githubTheme, {
    Hljs: hljs,
  });
const pinia = createPinia()
// 使用 pinia-plugin-persist 插件
pinia.use(piniaPluginPersist)
app.use(pinia)
app.use(drag)
app.use(router).use(ElementPlus, {locale: zhCn, size: "default"})
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(VMdEditor);
app.use(WangEditorPlugin);
app.mount('#app')
